def method(nums):
    d = {}
    for num in nums:
        if num not in d:
            d[num] = 0
        d[num] += 1
    # print(d)
    
    count = 0
    while d:
        # 0 取一个数
        item = d.popitem()
        # print(item)
        if item[1] > 1:
            d[item[0]] = item[1] - 1
        num = item[0]

        # 1 删左边
        for i in range(1, len(nums)):
            index = num - i
            if index in d:
                d[index] -= 1
                if d[index] <= 0:
                    d.pop(index, None)
            else:
                break
        # 2 删右边
        for i in range(1, len(nums)):
            index = num + i
            if index in d:
                d[index] -= 1
                if d[index] <= 0:
                    d.pop(index, None)
            else:
                break
        count += 1

        # print(f'[after pop]{d}')
    
    return count 

if __name__ == '__main__':
    _ = input()
    nums = list(map(int, input().split(' ')))
    count = method(nums)
    print(count)
